From da22ba3b867ff2a3899ebc791a53a6b2b2e50478 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 4 Jul 2018 08:32:27 +0200 Subject: [PATCH] drag: Split a setter In preparation for moving the suggested action to the x11 backend, split the setter off. --- gdk/gdkdrag.c | 14 +++++++++----- gdk/gdkdragprivate.h | 3 ++- gdk/x11/gdkdnd-x11.c | 3 ++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gdk/gdkdrag.c b/gdk/gdkdrag.c index 63c76153f7..ff8472d259 100644 --- a/gdk/gdkdrag.c +++ b/gdk/gdkdrag.c @@ -249,7 +249,7 @@ gdk_drag_set_property (GObject *gobject, case PROP_ACTIONS: { GdkDragAction actions = g_value_get_flags (value); - gdk_drag_set_actions (drag, actions, drag->suggested_action); + gdk_drag_set_actions (drag, actions); } break; @@ -610,11 +610,8 @@ gdk_drag_write_finish (GdkDrag *drag, void gdk_drag_set_actions (GdkDrag *drag, - GdkDragAction actions, - GdkDragAction suggested_action) + GdkDragAction actions) { - drag->suggested_action = suggested_action; - if (drag->actions == actions) return; @@ -623,6 +620,13 @@ gdk_drag_set_actions (GdkDrag *drag, g_object_notify_by_pspec (G_OBJECT (drag), properties[PROP_ACTIONS]); } +void +gdk_drag_set_suggested_action (GdkDrag *drag, + GdkDragAction suggested_action) +{ + drag->suggested_action = suggested_action; +} + void gdk_drag_set_selected_action (GdkDrag *drag, GdkDragAction action) diff --git a/gdk/gdkdragprivate.h b/gdk/gdkdragprivate.h index 835dd26807..71dca2a888 100644 --- a/gdk/gdkdragprivate.h +++ b/gdk/gdkdragprivate.h @@ -78,7 +78,8 @@ struct _GdkDrag { void gdk_drag_set_cursor (GdkDrag *drag, GdkCursor *cursor); void gdk_drag_set_actions (GdkDrag *drag, - GdkDragAction actions, + GdkDragAction actions); +void gdk_drag_set_suggested_action (GdkDrag *drag, GdkDragAction suggested_action); void gdk_drag_set_selected_action (GdkDrag *drag, GdkDragAction action); diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index b45542ff4a..e6b410efa0 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -1477,7 +1477,8 @@ gdk_x11_drag_drag_motion (GdkDrag *drag, if (drag_x11->drag_surface) move_drag_surface (drag, x_root, y_root); - gdk_drag_set_actions (drag, possible_actions, suggested_action); + gdk_drag_set_actions (drag, possible_actions); + gdk_drag_set_suggested_action (drag, suggested_action); if (protocol == GDK_DRAG_PROTO_XDND && drag_x11->version == 0) { -- 2.30.2